
<div class="page-group">
    <div class="page page-current" id="page-mycar">
		<header class="bar bar-nav">
		    <a class="button button-link button-nav pull-left back" href="javascript:;" ng-click="goback()">
		        <span class="icon icon-left"></span>返回</a>
		    <h1 class="title">我的手机号</h1>
		</header>
		<div class="content native-scroll">
		    <div class="list-block">
		    	<div class="content-block-title">为保证挪车功能正常使用，请先绑定手机号码</div>
		        <ul>
		        	
		            <li ng-if="pagedata.member.old">
				      	<div class="item-content">
				        	<div class="item-inner">
				        		<div class="item-title label" style="color:#333;">旧号码</div>
				          		<div class="item-input">
				            		<input type="text" name="oldtel" id="oldtel" ng-model="pagedata.member.mobile" readonly>
				          		</div>
				        	</div>
				      	</div>
				    </li>
					<li>
				      	<div class="item-content">
				        	<div class="item-inner">
				        		<div class="item-title label" style="color:#333;">手机号码</div>
				          		<div class="item-input">
				            		<input type="tel" name="mobile" id="loginmobile" ng-model="pagedata.member.new" placeholder="请输入手机号码" value="">
				          		</div>
				        	</div>
				      	</div>
				    </li>
		            <li>
				      	<div class="item-content">
				        	<div class="item-inner">
				        		<div class="item-title label" style="color:#333;">验证码</div>
				          		<div class="item-input">
				            		<input type="tel" name="code" id="logincode"  ng-model="pagedata.member.smscode" placeholder="请输入验证码">
				          		</div>
				          		<div id="getVerifyCode" ng-click="pagedata.send(pagedata.member.new)" class="verifycode">发送验证码</div>
				        	</div>
				      	</div>
				    </li>

		        </ul>
		    </div>
		    <div ng-if="pagedata.member.old" class="content-block">
		        <div class="row">
		            <div class="col-100">
		                <a href="javascript:;" ng-click="post(pagedata.member,'post')" class="weui_btn weui_btn_warn">更换手机号</a>
		            </div>
		        </div>
		    </div>
		    <div ng-if="!pagedata.member.old" class="content-block">
		        <div class="row">
		            <div class="col-100">
		                <a href="javascript:;" ng-click="post(pagedata.member,'post')" class="weui_btn weui_btn_primary" id="savemycar">提交绑定</a>
		            </div>
		        </div>
		    </div>
		</div>
	</div>
</div>
<script type="text/javascript">
	scope.pagedata.send=function(mobile){
	if(!mobile){
		alert('请先填写手机号！');
		return false;
	}
	if(scope.pagedata.sending){
		return false;
	}
	var params={'data':{'mobile':mobile},'op':'send_verifycode','plugin':'core','action':'member.mobile'};
	params.callback=function(res){
		if(res=='success'){
			//发送成功，开始倒计时 
			scope.pagedata.sending=true;
			scope.count_down(60,'getVerifyCode','秒后重新发送',function(){
				scope.pagedata.sending=false;
				$('#getVerifyCode').text('重新发送');
			});
		}else{
			scope.message('验证码发送失败！');
		}
	}
	scope.post_json(params);
}
</script>
